﻿<%@ WebHandler Language="C#" Class="TimeCapsule.CheckValid" %>

using System;
using System.Web;

namespace TimeCapsule
{
	public class CheckValid : IHttpHandler
	{
		string id;
		bool valid = false;
		public void ProcessRequest(HttpContext context)
		{
			context.Response.ContentType = "application/json";
			id = context.Request.Form.Get("id").Trim();
			
			dbAccess da = new dbAccess();
			valid = da.CheckValidEmail(id);
			context.Response.Write(string.Format("{{\"valid\":{0}}}", valid.ToString().ToLower()));
		}

		public bool IsReusable
		{
			get
			{
				return false;
			}
		}
	}
}